package com.cloudpan.common.exception;


import com.cloudpan.common.ResultCodeMsg;
import lombok.Getter;

/**
 * @Author sc
 * @DATE 2023/7/13 15:11
 * @Description:
 * @Version 1.0
 */
@Getter
public class GlobalExceptionHandler extends RuntimeException {

    private ResultCodeMsg codeEnum;
    private Integer code;
    private String message;

    public GlobalExceptionHandler(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    public GlobalExceptionHandler(String message) {
        super(message);
        this.message = message;
    }

    public GlobalExceptionHandler(Throwable e) {
        super(e);
    }

    public GlobalExceptionHandler(ResultCodeMsg result) {
        super(result.getMsg());
        this.codeEnum = result;
        this.code = result.getCode();
        this.message = result.getMsg();
    }

    public GlobalExceptionHandler(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

}
